﻿#include "jmstemplate.h"
JmsTemplate::JmsTemplate(cms::Connection* connection, cms::ConnectionFactory *connectionFactory )
: activemq::cmsutil::CmsTemplate(connectionFactory),jmsconnection(connection),log( Log4Qt::Logger::logger("poc.JmsTemplate"))
{
}
JmsTemplate::~JmsTemplate(void){}

cms::Connection* JmsTemplate::createConnection()
{
	if( jmsconnection == NULL ) {
		// Invoke the base class to create the connection and add it
		// to the resource lifecycle manager.
		jmsconnection = createConnection();
		//jmsconnection->setExceptionListener(this);
		// Start the connection.
		jmsconnection->start();
	}
	return jmsconnection;
}
